<?php
  /*Project.php
  * A collecion of employees, used for accounting purposes
  * An employee may be a member of multiple projects simultaneously
  */
class Project extends AppModel
{
	var $name = 'Project';
	public $actsAs = array('Containable');
	var $primaryKey = 'project_id';
	//validation rules
        var $validate = array(
	'project_id'=> array(
		'rule'=>'numeric',
		'required'=>true
	));
	public $hasAndBelongsToMany = array(
			'Employees' => array(
				'className'              => 'Employee',
				'joinTable'              => 'project_members',
				'foreignKey'             => 'project_id',
				'associationForeignKey'  => 'employee_id',
				),
			);
	public $hasMany = array(
			'ProjectMember' => array(
				'className'=>'ProjectMember',
				'conditions' => array('ProjectMember.project_id'=> '$this->project_id')
				)
			);
}
?>
